import {get, post, postForLogin, upload} from './http'

// music-api
export const uploadMusic = p => upload('/music/uploadMusic', p);
export const exactMatch = p => get('/music/getMusicListByName', p);
export const fuzzyQuery = p => get('/music/fuzzySearchMusic', p);
export const countMusic = p => get('/music/countMusic', p);
export const randMusic = p => get('/music/randMusic', p);


// comments-api
export const getComments = p => get('/comments/getCommentsByMusicId', p);
export const insertComments = p => get('/comments/insertFirstComment', p);
export const replyComments = p => get('/comments/reply', p);

// auth-api
export const login = p => postForLogin('/user/login', p);  // p: userName,password
export const register = p => post('/user/register', p);  //  p: user

//user-api

export const getUserByName = p => post('/userInfo/getUserByName', p);
export const editPasswordByName = p => post('/userInfo/editPasswordByName', p);
export const editUserInfo = p => post('/userInfo/editUserInfoByName', p);
export const editStatus = p => post('/userInfo/editStatusByName', p);
export const updateSignature = p => post('/userInfo/updateSignature', p);
